package Solutions

import (
	"strconv"
	"strings"
)

func convertTime(current string, correct string) int {
	chilStrs := strings.Split(current, ":")
	hourCurrent, _ := strconv.Atoi(chilStrs[0])
	minutesCurrent, _ := strconv.Atoi(chilStrs[1])
	chilStrs = strings.Split(correct, ":")
	hourCorrect, _ := strconv.Atoi(chilStrs[0])
	minutesCorrect, _ := strconv.Atoi(chilStrs[1])
	dif := 0
	if hourCorrect < hourCurrent {
		dif += (24 - hourCurrent + hourCorrect) * 60
	} else {
		dif += (hourCorrect - hourCurrent) * 60
	}
	// fmt.Println(dif)
	dif -= minutesCurrent
	dif += minutesCorrect
	ans := 0
	ans += dif / 60
	dif %= 60
	ans += dif / 15
	dif %= 15
	ans += dif / 5
	dif %= 5
	ans += dif
	return ans

}
